home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / misc / ada1110b.lha / AmigaSources / config.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-15  |  6.7 KB  |  254 lines

  1. /*
  2.  * Copyright (C) 1985-1992  New York University
  3.  * 
  4.  * This file is part of the Ada/Ed-C system.  See the Ada/Ed README file for
  5.  * warranty (none) and distribution info and also the GNU General Public
  6.  * License for more details.
  7.  
  8.  */
  9. #ifndef _config_h
  10. #define _config_h
  11.  
  12. /* header file with common symbols to be used by all phases of Ada/Ed-C
  13.  *
  14.  * Note that some configuration information needs to be defined when porting
  15.  * to a new machine or operating system.
  16.  *
  17.  * Most importantly the following symbolic constants need to be set for
  18.  * each host
  19.  *
  20.  * WORDSIZE32 or WORDSIZE16 -- whether an "int" is 32 bits or 16 bits
  21.  * BSD or SYSTEM_V          -- for unix systems
  22.  * OP_SYS                   -- string representing info on machine/OS config
  23.  * ALIGN2 or ALIGN4         -- systems which need alignment as explained below
  24.  *
  25.  * ALIGN2 defined if data items other than char must be aligned on at least
  26.  * 2 byte boundaries. (e.g. MC68000).
  27.  * ALIGN4 defined if data items other than char must be aligned on at least
  28.  * 4 byte boundaries. (e.g. SPARC).
  29.  */
  30.  
  31. /* AMIGA NOTE:                                                           */
  32. /* Since some of the source files had differing machine defines due to   */
  33. /* certain incompatibilites, I found no other choice but to force some   */
  34. /* of the defines (or risk missing out on things like ALIGN2...)         */
  35.  
  36. #define OP_SYS "AmigaDos"
  37. #define NULLFILENAME "nil:"
  38. #define WORDSIZE32
  39.  
  40. #ifdef mc68000
  41. #define ALIGN2
  42. #endif
  43.  
  44. #ifdef sun
  45. #define WORDSIZE32
  46. #ifndef BSD
  47. #define BSD
  48. #endif
  49. #ifdef mc68000
  50. #define ALIGN2
  51. #define OP_SYS "Sun 3 - Sun OS"
  52. #endif
  53. #ifdef sparc
  54. #define ALIGN4
  55. #define OP_SYS "Sparc - Sun OS"
  56. #endif
  57. #endif
  58.  
  59. #ifdef att3b
  60. #define WORDSIZE32
  61. #define SYSTEM_V
  62. #define ALIGN2
  63. #define OP_SYS "ATT 3B"
  64. #endif
  65.  
  66. #ifdef ALIGN4 
  67. #define ALIGN2
  68. #endif
  69.  
  70. #ifdef ALIGN2
  71. #define ALIGN_WORD
  72. #endif
  73.  
  74. #if (defined BSD) || (defined SYSTEM_V)
  75. #ifndef unix
  76. #define unix
  77. #endif
  78. #endif
  79.  
  80. /* 
  81.  * The following symbolic constants are defined for most implementations
  82.  * and only need to be changed if necessary.
  83.  * 
  84.  * NULLFILENAME -- a name representation a null file
  85.  *
  86.  * Return codes passed between phases:
  87.  *  RC_SUCCESS            everything ok 
  88.  *    RC_ERRORS            errors found, successful termination
  89.  *    RC_INTERNAL_ERROR    internal compiler error
  90.  *    RC_ABORT            e.g. file not found
  91.  *
  92.  * MACHINE_CODE -- defined to turn on capability for generated code trace
  93.  * in the compilation listing 
  94.  *
  95.  * HI_LEVEL_IO -- forces use of the high level i/o package of C rather than
  96.  * the low level i/o package.
  97.  *
  98.  * LIBFILENAME -- the name of the library file. It should be "lib" unless
  99.  * the operating system at hand uses this for another meaning.
  100.  *
  101.  */
  102.  
  103. #define RC_SUCCESS         0
  104. #define RC_ERRORS          1
  105. #define RC_INTERNAL_ERROR  2
  106. #define RC_ABORT           3
  107. #define MACHINE_CODE
  108. #define HI_LEVEL_IO
  109. #define LIBFILENAME "lib"
  110. #define OM NULL
  111.  
  112. #ifdef unix
  113. #define DIR_DELIMITER  "/"
  114. /* #define NULLFILENAME "/dev/null" */
  115. #define SUPPORT_PRAGMA_INTERFACE
  116. #endif
  117.  
  118. #ifdef vms
  119. #define WORDSIZE32
  120. #undef RC_SUCCESS
  121. #undef RC_ERRORS
  122. #undef RC_INTERNAL_ERROR
  123. #undef RC_ABORT
  124. #define RC_SUCCESS          241
  125. #define RC_ERRORS           245
  126. #define RC_INTERNAL_ERROR   249
  127. #define RC_ABORT            253
  128. #define DIR_DELIMITER .
  129. #define OP_SYS "VAX/VMS 5.0"
  130. #define NULLFILENAME "nl:"
  131. /* use low level io since at time the high level io didn't work on VMS */
  132. #undef  HI_LEVEL_IO
  133. #define LO_LEVEL_IO
  134. #undef LIBFILENAME
  135. /* Some vms sites running eunice use lib  to corresond to unix lib  */
  136. #define LIBFILENAME "adalib"
  137. #endif
  138.  
  139. #ifdef IBM_PC
  140. #define WORDSIZE32
  141. #define OP_SYS "(MS/DOS 3.0)"
  142. #define NULLFILENAME "NUL"
  143. #define DIR_DELIMITER  "\\"
  144. /* pass error message strings by phrase number */
  145. #define ERRNUM
  146. /* for some reason, the PC doesn't like the name str_errmsgn, so rename */
  147. #define str_errmsgn s_ermsgn
  148. #define PREDEF_PC
  149. /* define DEBUG_INT to enable -i i instruction trace */
  150. /* enable on PC until certified except for EXPORT version */
  151. #ifndef EXPORT
  152. #define DEBUG_INT
  153. #endif
  154. /* define IO_EOF to avoid bug in Metaware library when try to read
  155.  * past end of file; problem is that when call fgetc after EOF seen
  156.  * Metaware library goes into loop. (shields 7-8-86)
  157.  */
  158. #define IO_EOF
  159. #endif
  160.  
  161. #ifdef WORDSIZE32
  162. #define DIGS    4
  163. #define BAS    10000
  164. #define MAX_INTEGER 2147483647
  165. #define MIN_INTEGER -2147483648
  166. #define ADA_MANTISSA_SIZE    24
  167. /* BITS_SU gives the number of bits in a storage unit. */
  168. #define BITS_SU 32
  169. #endif
  170.  
  171. #ifdef WORDSIZE16
  172. #define DIGS    2
  173. #define BAS    100
  174. #define MAX_INTEGER    32767
  175. #define MIN_INTEGER    -32768
  176. /* Define MAX_INTEGER_LONG if C ints and longs have different sizes. */
  177. #define MAX_INTEGER_LONG 2147483647
  178. #define MAX_INTEGER_LONG_STRING "2147483647"
  179. #define ADA_MANTISSA_SIZE    24
  180. /* BITS_SU gives the number of bits in a storage unit. */
  181. #define BITS_SU 16
  182. #endif
  183.  
  184. #define TRUE 1
  185. #define FALSE 0
  186.  
  187. /* Error codes written by various phases to MSGFILE */
  188. /* Note: None of these should be defined to be 0 */
  189.  
  190. #define PRAGMA_LIST_ON 1
  191. #define PRAGMA_LIST_OFF 2
  192. #define PRAGMA_LIST_ERR 3
  193. #define PRAGMA_PAGE 4
  194.  
  195. #define ERR_LEXICAL 10
  196. #define ERR_SYNTAX 11
  197. #define ERR_SEMANTIC 12
  198. #define ERR_WARNING 13
  199. #define INFORMATION 14
  200. #define ERR_BIND    15
  201. #define ERR_COMPILER 16
  202.  
  203. /* Limits for interpreter */
  204.  
  205. #define MAX_PRIO        5  /* max priority value, prio = 0..5 */
  206. #define MAX_TASKS     128  /* max number of tasks */
  207. #define MAX_CUNITS     64  /* max number of compilation units */
  208. #define MAX_BODIES    256  /* max subprgs+task bodies+spec/body not in cunit */
  209. #define MAX_ALTS       64  /* maximum open alternatives */
  210. #define MAX_DISCR      64  /* maximum number of discriminants in record */
  211. #define MAX_IDLEN     256  /* maximum identifier length */
  212. #define MAX_LINE_LEN  256  /* maximum line length */
  213.  
  214. #ifdef IBM_PC
  215. #define MAX_MEM    32000  /* maximum words per heap */
  216. #else
  217. #define MAX_MEM    128000 /* maximum words in heap */
  218. #endif
  219.  
  220. /* version numbers for library files */
  221. #define AIS_VERSION '1'
  222. #define AST_VERSION '1'
  223. #define LIB_VERSION '1'
  224. #define STUB_VERSION '1'
  225. #define TRE_VERSION '1'
  226.  
  227. /*  The following is a variable used for deciding whether to optimize
  228.  *  an array aggregate.  If specifies the maximum size of a segment
  229.  *  to be created on the data stack.  If an array aggregate is larger
  230.  *  than this, is will NOT be optimized.
  231.  *  It is also used in type.c in a way that should be reviewed (ds 7-18-86)
  232.  */
  233. #define MAX_STATIC_SIZE 10000
  234.  
  235. /* define SMALLOC to use smalloc for string allocation */
  236. #define SMALLOC
  237.  
  238. #ifndef EXPORT
  239. #define DEBUG
  240. #define CHAOS    
  241. #define TRACE
  242. /* define IOT to compile trace code for i/o */
  243. #define IOT
  244. #else
  245. #define chaos(v)             exit_internal_error()
  246. #define emalloct(n,s)            emalloc(n)
  247. #define malloct(n,s)            malloc(n)
  248. #define erealloct(ptr, size, msg)    erealloc(ptr, size)
  249. #define efreet(p,msg)            efree(p)
  250. #define ecalloct(n,m,msg)        ecalloc(n,m)
  251. #endif
  252.  
  253. #endif /* _config_h */
  254.